package com.easywork.mystery.fallback;

import org.springframework.stereotype.Component;

import com.easywork.mystery.entity.SysUser;
import com.easywork.mystery.rpc.DemoService;

import feign.hystrix.FallbackFactory;

/**
 * 熔断器
 * 
 * @author Administrator
 *
 */
@Component
public class MyFallbackFactory implements FallbackFactory<DemoService> {

	@Override
	public DemoService create(Throwable arg0) {
		return new DemoService() {
			@Override
			public SysUser getSysUserByAccount(String account, String token) {
				System.out.println("getSysUserByAccount--服务器熔断");
				return null;
			}

			@Override
			public SysUser getSysUser(String id, String token) {
				System.out.println("getSysUser--服务器熔断");
				return null;
			}
		};
	}

}
